package com.buyingtickets.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author Hexz
 * @date 2021/6/23 23:09
 */
public class Train {
    private int trainId;//列车ID
    private String trainName;//列车名称
    private Type trainType;//车次类型
    private Site start;//站点对象：起点站
    private Site destination;//站点对象：终点站
    private Type trainStatusType;//列车状态类型
    private int mileagePrice;//里程价格
    @JsonFormat(pattern = "HH:mm",timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm")
    private Date departureTime;//出发时间：时分秒

    @Override
    public String toString() {
        return "Train{" +
                "trainId=" + trainId +
                ", trainName='" + trainName + '\'' +
                ", trainType=" + trainType +
                ", start=" + start +
                ", destination=" + destination +
                ", trainStatusType=" + trainStatusType +
                ", mileagePrice=" + mileagePrice +
                ", departureTime=" + departureTime +
                '}';
    }

    public int getTrainId() {
        return trainId;
    }

    public void setTrainId(int trainId) {
        this.trainId = trainId;
    }

    public String getTrainName() {
        return trainName;
    }

    public void setTrainName(String trainName) {
        this.trainName = trainName;
    }

    public Type getTrainType() {
        return trainType;
    }

    public void setTrainType(Type trainType) {
        this.trainType = trainType;
    }

    public Site getStart() {
        return start;
    }

    public void setStart(Site start) {
        this.start = start;
    }

    public Site getDestination() {
        return destination;
    }

    public void setDestination(Site destination) {
        this.destination = destination;
    }

    public Date getDepartureTime() {
        return departureTime;
    }

    public void setDepartureTime(Date departureTime) {
        this.departureTime = departureTime;
    }

    public Type getTrainStatusType() {
        return trainStatusType;
    }

    public void setTrainStatusType(Type trainStatusType) {
        this.trainStatusType = trainStatusType;
    }

    public int getMileagePrice() {
        return mileagePrice;
    }

    public void setMileagePrice(int mileagePrice) {
        this.mileagePrice = mileagePrice;
    }
}